<?php
class GoodMangeAction extends Action {
	public function index () {
            $good=D('goods');
            $good_data=$good->select();
            
            //var_dump($good_data);
            $this->assign('good_data',$good_data);
		$this->display();

	}
        public function editor () {
		$this->display();

	}
	public function add(){
                if($_POST['sub']){
                    $load=new File_load('upload',array('image/pjpeg','image/jpg','image/jpeg','image/png','image/x-png','image/gif'),'2000000');
                    if(!$load->upload()){
                        echo $load->getmessage;
                    }else {
                        if (get_magic_quotes_gpc()) {
                               $_POST['introduction'] = stripslashes($_POST['introduction']);
                        } else {
                                $_POST['introduction'] = $_POST['introduction'];
                        }
                        $_POST['pic']=$load->newnames;
                        //var_dump($_POST);
                         $good=D('goods');
                          $good->create();
                         $good->add();
                    
                    }
                
                }
                $good=D('goods');
                $cat=new Cat_tab();
                $cat_slid=$cat->cat_list();
                $this->assign('cat_slid',$cat_slid);
		$this->display();
	}

}
